ID Property (AddressEntry Object) 

The ID property returns the unique identifier of the object as a string. Read-only.

Syntax

objAddressEntry.ID

Data Type

String

Remarks

You can use the AddressEntry object s ID property as a parameter to the Recipient object s Add method.

MAPI systems assign a permanent, unique ID string when an object is created. These identifiers do not change from one MAPI session to another.

The ID property corresponds to the MAPI property PR_ENTRYID, converted to a string of hexadecimal characters.

Example

This example copies information from an AddressEntry object to a Recipient object:

' Function: Recipients_Add_EntryID

' Purpose: Add a new recipient to the collection using AddressEntry ID

Function Recipients_Add_EntryID()

Dim strID As String      ' ID from Message.Sender

Dim strName As String    ' name from Message.Sender

Dim objNewMsg As Object  ' new msg; set its recipient using ID

Dim objNewRecip As Object ' Recipient of new message, set from ID, name

    ' error handling

    strID = objOneMsg.Sender.Id   'Address Entry object ID

    strName = objOneMsg.Sender.Name

    Set objNewMsg = objSession.Outbox.Messages.Add

    If objNewMsg Is Nothing Then

        MsgBox "Could not create a new message"

        Exit Function

    End If

    objNewMsg.Subject = "Sample message from OLE Messaging Library"

    objNewMsg.Text = "Called Recipients.Add method w/ entryID parameter"

    Set objNewRecip = objNewMsg.Recipients.Add( _

                      entryID:=strID, _

                      Name:=strName)

    If objNewRecip Is Nothing Then

        MsgBox "Could not create a new recipient"

        Exit Function

    End If

    objNewMsg.Update

    objNewMsg.Send showDialog:=False

    MsgBox "Created a new message in the Outbox and sent it"

    Exit Function

    ' error handling

End Function

 

See Also

Add Method (Recipients Collection)8ETUGE